1 /*
2  * Copyright 2019 The Android Open Source Project
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 /**
18  * @file hdr_metadata.h
19  */
20 
21 module android.ndk.hdr_metadata;
22 
23 import arsd.jni;
24 import android.ndk;
25 
26 extern (C):
27 nothrow:
28 @nogc:
29 
30 /**
31  * These structures are used to define the display's capabilities for HDR content.
32  * They can be used to better tone map content to user's display.
33  */
34 
35 /**
36  * HDR metadata standards that are supported by Android.
37  */
38 enum AHdrMetadataType
39 {
40     HDR10_SMPTE2086 = 1,
41     HDR10_CTA861_3 = 2,
42     HDR10PLUS_SEI = 3
43 }
44 
45 /**
46  * Color is defined in CIE XYZ coordinates.
47  */
48 struct AColor_xy
49 {
50     float x;
51     float y;
52 }
53 
54 /**
55  * SMPTE ST 2086 "Mastering Display Color Volume" static metadata
56  */
57 struct AHdrMetadata_smpte2086
58 {
59     AColor_xy displayPrimaryRed;
60     AColor_xy displayPrimaryGreen;
61     AColor_xy displayPrimaryBlue;
62     AColor_xy whitePoint;
63     float maxLuminance;
64     float minLuminance;
65 }
66 
67 /**
68  * CTA 861.3 "HDR Static Metadata Extension" static metadata
69  */
70 struct AHdrMetadata_cta861_3
71 {
72     float maxContentLightLevel;
73     float maxFrameAverageLightLevel;
74 }
75 
76 // ANDROID_HDR_METADATA_H